package work.gac.unbind.v2.unbinder;

import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import lombok.extern.slf4j.Slf4j;
import work.gac.unbind.v2.DatalakUtil;
import work.gac.unbind.v2.MediaAccount;
import work.gac.unbind.v2.Setting;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author Gong.Yang
 */
@Slf4j
public class GacMiniUnbind implements Unkinder {
    private static final String fromSocialCode = "阿玛尼小程序";

    @Override
    public boolean match(String tag) {
        return tag.contains(fromSocialCode);
    }

    @Override
    public Runnable process(String thirdCode, String mobile) {
        return () -> {
            String openId = DatalakUtil.getOpenId(mobile, fromSocialCode);
            DatalakUtil.unbind(mobile, openId);
        };
    }
}
